﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Http.Filters;
using WebApiV2.Domain.Entity;
using WebApiV2.Utils.Log;

namespace WebApiV2.Utils
{
    public class GlobaExceptionFillter : IExceptionFilter
    {
        private readonly Logs _logs;
        public GlobaExceptionFillter(Logs logs)
        {
            _logs = logs;
        }
        public void OnException(ExceptionContext filterContext)
        {
            _logs.Erro(filterContext.Exception);

            filterContext.ExceptionHandled = true;
        }

        
    }
}
